package com.example.action;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
@ConditionalOnProperty(prefix="spring.profiles", name = "active", havingValue = "kafka", matchIfMissing = false) 
public class KafkaConsumer {
	private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(KafkaConsumer.class);
	//https://developer.51cto.com/art/202112/694012.htm
    @KafkaListener(topics = AppController.TOPIC)
    public void consume(String message) {
        log.info(">>>>>>> consume message: {}", message);
    }
}
